package com.wzh.util;

/**
 * @description:
 * @author: WZH
 * @time: 2021/6/15 9:50
 */
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;

import java.io.IOException;
import java.util.HashMap;
import java.util.concurrent.TimeoutException;

public class ConnectionUtils {


    public static Connection getConnection(){

        ConnectionFactory factory = new ConnectionFactory();
        factory.setHost("192.168.222.134");
        factory.setPort(5672);
        factory.setUsername("guest");
        factory.setPassword("guest");

        Connection conn = null;

        try {
            conn = factory.newConnection();
        } catch (IOException e) {
            e.printStackTrace();
        } catch (TimeoutException e) {
            e.printStackTrace();
        }

        HashMap<String, Double> kvHashMap = new HashMap<String, Double>(16, 8);

        return conn;
    }

}